package com.liwen.kefu.common.result;

import lombok.ToString;

/**
 * @author: Liwen
 * @createTime: 2024/11/9
 * @description:
 */
@ToString
public enum CommonCode {

    SUCCESS(200, true, "操作成功"),
    FAIL(500, false, "操作失败"),
    ADD_SUCCESS(200, true, "添加成功"),
    UPDATE_SUCCESS(200, true, "修改成功"),
    CONFIG_FAIL(500, false, "添加hive查询sql失败了！"),
    QUERY_USER_ID_FAIL(500, false, "查询userId失败了！"),
    DELETE_KEYS_FAIL(500, false, "删除测试环境数据失败了！"),
    HIVE_QUERY_FAIL(500, false, "hive查询失败了！"),
    BASE_TABLE_QUERY_FAIL(500, false, "测试环境查询配置表失败了！"),
    GET_VALUES_BY_KEY_FAIL(500, false, "根据key获取删除的value时，失败了！"),
    INSERT_INTO_FAIL(500, false, "插入测试环境失败了！");


    private int code;
    private boolean success;
    private String message;

    CommonCode(int code, boolean success, String message) {
        this.code = code;
        this.success = success;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public boolean getSuccess() {
        return success;
    }

    public String getMessage() {
        return message;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
